<template>
  <div v-if="RightScope"
       @click="cencel"
       @touchmove.prevent
       class="RightScope">
    <mt-popup v-model="RightScope "
              position="right"
              popup-transition="popup-fade">
      <div @click.stop
           class="rightSlot">
        <div class="title">
          <span class="cen">条件筛选</span>
          <span @click="clear"
                class="cls">清空条件</span>
        </div>
        <div class="container">
          <div v-for="(item,index) in rightList"
               :key="index">
            <div class="block"
                 v-if="item.show">
              <p class="tit">
                <span>{{item.title}}</span>
                <img @click="item.dis=!item.dis"
                     :class="!item.dis?'':'up'"
                     src="../assets/images/icon/class_upArrow.png"
                     alt="">
              </p>
              <ul v-show="!item.dis" class="clearfix">
                <li class="bsb"
                    v-for="(ite,ind) in item.list"
                    :key="ind">
                  <span @click="btnClick(item,ite)"
                        :class="{'active':item.id==ite.id}"
                        class="btn">{{ite.label}}</span>
                </li>
              </ul>
            </div>
          </div>
        </div>
        <div class="bot_box">
          <div class="cencel"
               @click="cencel">取消</div>
          <div class="sure"
               @click="submit">确定</div>
        </div>
      </div>
    </mt-popup>
  </div>
</template>
<script>
import { type } from 'os'
export default {
  name: 'rightScope',
  props: {
    rightList: {
      type: Array,
      default() {
        return []
      }
    },
    RightScope: {
      type: Boolean,
      default() {
        return false
      }
    }
  },
  data() {
    return {
    //   up: false
    }
  },
  methods: {
    cencel() {
      this.$emit('cencel')
    },
    clear() {
      this.$emit('clear')
    },
    btnClick(item, ite) {
      this.$emit('btnClick', item, ite)
    },
    submit() {
      this.$emit('submit')
    }
  }
}
</script>
<style lang="less" scoped>
.RightScope {
  position: absolute;
  top: 0;
  right: 0;
  width: 100vw;
  height: 100vh;
  .rightSlot {
    background-color: #fff;
    opacity: 1;
    height: 100vh;
    width: 80vw;
    .title {
      height: 35px;
      // line-height: 95px;
      padding: 30px 0;
      text-align: center;
      border-bottom: 1px solid rgba(232, 232, 232, 1);
      .cen {
        height: 31px;
        font-size: 32px;
        font-weight: 500;
        color: rgba(34, 34, 34, 1);
        line-height: 33px;
      }
      .cls {
        height: 28px;
        position: absolute;
        right: 35px;
        // top: 40px;
        font-size: 30px;
        font-weight: 500;
        color: rgba(20, 200, 255, 1);
        line-height: 33px;
      }
    }
    .container {
      padding: 0 26px 0 34px;
      .block {
        margin-bottom: 54px;
        .tit {
          margin: 34px 0 30px;
          height: 33px;
          font-size: 30px;
          font-weight: 500;
          color: rgba(34, 34, 34, 1);
          line-height: 33px;
          display: flex;
          justify-content: space-between;
          align-items: center;
          img {
            width: 20px;
            height: 12px;
            padding: 10px;
            &.up {
              transform: rotate(-180deg);
            }
          }
        }
        ul {
          li {
            // width: 120px;
            min-width: 120px;
            padding: 0 10px;
            height: 48px;
            background: rgba(240, 242, 245, 1);
            border-radius: 24px;
            float: left;
            text-align: center;
            margin: 0 20px 34px 0;
            &:nth-of-type(4n) {
              margin-right: 0;
            }
            .btn {
              // width: 50px;
              height: 25px;
              font-size: 26px;
              font-weight: 500;
              color: rgba(103, 106, 107, 1);
              line-height: 48px;
              &.active {
                color: rgba(20, 200, 255, 1);
              }
            }
          }
        }
      }
    }
    .bot_box {
      position: absolute;
      display: flex;
      z-index: 10;
      justify-content: space-around;
      bottom: 0;
      height: 80px;
      line-height: 80px;
      width: 100%;
      border-top: 1px solid rgba(229, 229, 229, 1);
      .cencel {
        border-right: 1px solid #ccc;
      }
      div {
        flex: 1;
        text-align: center;
        font-size: 30px;
        font-weight: 500;
        color: rgba(102, 102, 102, 1);
      }
    }
  }
}
</style>
